package com.xfi.liuliangjun;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Toast;

import com.xfi.liuliangjun.util.wechat.UserInfoListener;
import com.xfi.liuliangjun.util.wechat.WeChatUtil;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    public void wechat_login(View view){
        if(WeChatUtil.isWXInstall()){
            WeChatUtil.accreditSign(new UserInfoListener() {
                @Override
                public void getUserInfo(final String date) {
                    Toast.makeText(MainActivity.this, "用户信息"+date, Toast.LENGTH_SHORT).show();
                }
            });
        }else {
            Toast.makeText(this, "请先安装微信客户端", Toast.LENGTH_SHORT).show();
        }
    }
}
